using System.IO;
using SolutionFactory.Services;

namespace SolutionFactory_console
{
	internal class DeleteFileTypesFileVisitor : IFileVisitor
	{
		private readonly string[] _extensions;

		public DeleteFileTypesFileVisitor(params string[] extensions)
		{
			_extensions = extensions;
			
		}

		public void Visit(FileInfo file)
		{
			foreach (var extension in _extensions)
			{
				if(file.Name.ToLower().EndsWith(extension))
				{
					file.Delete();
					return;
				}
			}
			
		}
	}
}